package pb

import (
	"context"
	"github.com/gogf/gf/v2/frame/g"
	"go_end/internal/service"

	"go_end/api/pb/v1"
)

func (c *ControllerV1) SetSessionData(ctx context.Context, req *v1.SetSessionDataReq) (res *v1.SetSessionDataRes, err error) {

	service.Pb().SetSession(ctx, g.MapStrStr{
		"Accept":     "application/json, text/plain, */*",
		"Cookie":     req.Cookie,
		"User-Agent": req.UserAgent,
		"Referer":    req.Referer,
		"Host":       req.Host,
	})

	res = new(v1.SetSessionDataRes)
	res.Msg = "success"

	return res, err
}
